package cate.game.activity.dailygift.msg;

import cate.common.table.d.GDFunc;
import cate.game.GameBody;
import cate.game.activity.dailygift.DailyGiftActivity;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdDailyGift;

@ClientMsg(title = "每日特惠数据的请求")
public class DailyGiftDataReq implements MsgInput {
    @Override
    public MsgConfig conf() {
        return MsgIdDailyGift.DATA_REQ;
    }

    @Override
    public void execute(GameBody game, ClientContext cc) {
        DailyGiftActivity activity = cc.getRole().getActivity().getEnableActivitySingle(GDFunc.ACT_DAILY_GIFT);
        if (activity == null) {
            cc.getRole().getGame().notice.message(cc.getRole(), "活动未开启");
            return;
        }
        cc.getRole().sendNow(new DailyGiftDataResp(activity));
    }
}
